package com.cnb.exam.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.struts.ActionSupport;

import com.cnb.exam.service.ExamService;

public class TestAction extends Action{	
	public TestAction(){
		
	}
	
	public ActionForward execute(ActionMapping mapping,ActionForm form,
			HttpServletRequest request, HttpServletResponse response)throws Exception
		{
			ExamService examService = (ExamService) WebApplicationContextUtils.getRequiredWebApplicationContext(servlet.getServletContext()).getBean("examService");
			examService.addStudent("1qq", "q", "123456", "111", "111", "111", "1111", "001");
			return mapping.findForward("success");
		}

}
